package com.mz.demo.controller;

import com.mz.demo.entity.vo.AccountPasswordInfoVo;
import com.mz.demo.entity.vo.LoginResVo;
import com.mz.demo.service.LoginService;
import com.mz.demo.utils.entity.R;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class LoginController {

    @Resource
    private LoginService loginService;

    @PostMapping("/login")
    public R loginByAccountPassword( @RequestBody AccountPasswordInfoVo accountPasswordInfoVo) {

        LoginResVo loginResVo =  loginService.loginByAccountPassword( accountPasswordInfoVo );
        return R.ok(loginResVo);
    }
}
